<template>
	<view class="">
		<view class="mainCon"><jyf-parser :html="content"></jyf-parser></view>
		<mix-loading v-if="isLoading"></mix-loading>
	</view>
</template>

<script>
import jyfParser from '@/components/jyf-parser/jyf-parser.vue';
export default {
	components: {
		jyfParser
	},
	data() {
		return {
			content: '',
			id: ''
		};
	},
	onLoad(options) {
		if (options.id) this.id = options.id;
		if (options.name) this.setNavTitle(options.name);
		this.loadData();
	},
	methods: {
		async loadData() {
			const res = await this.$request('content/question-detail', { id: this.id }, { showLoading: true });
			if (res.result == 0) {
				this.content = res.data.answer;
			} else {
				this.$util.msg(res.resultNote);
			}
		}
	}
};
</script>

<style scoped>
.mainCon {
	padding: 20upx;
}
</style>
